package com.example.jacky.android_easeui.netapi;

import java.util.List;

/**
 * Created by xqc on 2016/9/21.
 * Developer App
 */
public class PageData<Content> {
    private static final String TAG = "PageData";

    public static final int START_PAGE = 1;

    /**
     * content : [{"id":"57d75c2516c87dd8f1441cd3","iconUrl":"http://soundbus-image.img-cn-shenzhen.aliyuncs.com/sunbar/test/user-icon/57d75c2516c87dd8f1441cd3_20c9ce1a-3eb3-4a1e-b3a3-c48914b4a126.jpg","nickName":"徒步华夏","signature":null,"followed":true}]
     * totalPages : 1
     * totalElements : 1
     * last : true
     * first : true
     * sort : null
     * numberOfElements : 1
     * size : 20
     * number : 0
     */

    private int totalPages;     //	总页数
    private int totalElements;  //总记录数
    private boolean last;
    private boolean first;      //是否第一页
    private Object sort;        //排序信息
    private int numberOfElements;   //当前页记录数
    private int size;       //每页最大记录数
    private int number;     //当前页，从0开始
    /**
     * id : 57d75c2516c87dd8f1441cd3
     * iconUrl : http://soundbus-image.img-cn-shenzhen.aliyuncs.com/sunbar/test/user-icon/57d75c2516c87dd8f1441cd3_20c9ce1a-3eb3-4a1e-b3a3-c48914b4a126.jpg
     * nickName : 徒步华夏
     * signature : null
     * followed : true
     */

    private List<Content> content;

    public int getTotalPages() {
        return totalPages;
    }

    public void setTotalPages(int totalPages) {
        this.totalPages = totalPages;
    }

    public int getTotalElements() {
        return totalElements;
    }

    public void setTotalElements(int totalElements) {
        this.totalElements = totalElements;
    }

    public boolean isLast() {
        return last;
    }

    public void setLast(boolean last) {
        this.last = last;
    }

    public boolean isFirst() {
        return first;
    }

    public void setFirst(boolean first) {
        this.first = first;
    }

    public Object getSort() {
        return sort;
    }

    public void setSort(Object sort) {
        this.sort = sort;
    }

    public int getNumberOfElements() {
        return numberOfElements;
    }

    public void setNumberOfElements(int numberOfElements) {
        this.numberOfElements = numberOfElements;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getNumber() {
        return number;
    }

    public void setNumber(int number) {
        this.number = number;
    }

    public List<Content> getContent() {
        return content;
    }

    public void setContent(List<Content> content) {
        this.content = content;
    }


    @Override
    public String toString() {
        return "PageData{" +
                "totalPages=" + totalPages +
                ", totalElements=" + totalElements +
                ", last=" + last +
                ", first=" + first +
                ", sort=" + sort +
                ", numberOfElements=" + numberOfElements +
                ", size=" + size +
                ", number=" + number +
                ", content=" + content +
                '}';
    }

    public boolean isNullData() {
        return content == null || content.size() == 0;
    }
}
